package com.example.raspberry_pi_demob.service;

import com.example.raspberry_pi_demob.DAO.EquipmentDAO;
import com.example.raspberry_pi_demob.entity.Equipment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class EquipmentService {
    @Autowired
    EquipmentDAO equipmentDAO;
    public List<Equipment> findEquipmentList() {
        return equipmentDAO.selectAll();
    }

    public Equipment findEquipment(String macAddress) {
        return equipmentDAO.selectByPrimaryKey(macAddress);
    }

    public int save(Equipment equipment) {
        return equipmentDAO.insert(equipment);
    }
}
